package cn.lg.soar.boot.fc.entity;

import cn.lg.soar.core.annotations.constraints.group.*;
import cn.lg.soar.database.query.annotations.*;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.*;
import io.swagger.annotations.*;
import lombok.Data;
import java.io.Serializable;
import java.time.*;
import javax.validation.constraints.*;

import cn.lg.soar.database.base.entity.BaseEntity;

/**
 * 表单项目子项
 * @author ZhuanZ（无密码）
 * @since 2025-01-16
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@Data
@ApiModel(value = "FormItem", description = "表单项目子项")
@TableName("fc_form_item")
public class FormItem extends BaseEntity {

    /** 主键 */
    @NotNull(message = "主键不能为空", groups = { Update.class })
    @ExcelIgnore
    @ApiModelProperty(value = "主键")
    @TableId
    private Long id;

    /** 表单收集id */
    @NotNull(message = "表单收集id不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "表单收集id")
    @ApiModelProperty(value = "表单收集id")
    private Long collectId;

    /** 表单项Id */
    @ExcelProperty(value = "表单项Id")
    @ApiModelProperty(value = "表单项Id")
    private String formItemId;

    /** 表单项类型 */
    @ExcelProperty(value = "表单项类型")
    @ApiModelProperty(value = "表单项类型")
    private String formItemType;

    /** 表单项标题 */
    @ExcelProperty(value = "表单项标题")
    @ApiModelProperty(value = "表单项标题")
    private String formItemLabel;

    /** 表单项目字段标识 */
    @ExcelProperty(value = "表单项目字段标识")
    @ApiModelProperty(value = "表单项目字段标识")
    private String formItemField;

    /** 是否显示标签(0-否 1-是) */
    @ExcelProperty(value = "是否显示标签(0-否 1-是)")
    @ApiModelProperty(value = "是否显示标签(0-否 1-是)")
    private Integer formItemShowLabel;

    /** 表单项默认值 */
    @ExcelProperty(value = "表单项默认值")
    @ApiModelProperty(value = "表单项默认值")
    private String formItemDefaultValue;

    /** 表单项是否必填 */
    @ExcelProperty(value = "表单项是否必填")
    @ApiModelProperty(value = "表单项是否必填")
    private Integer formItemRequired;

    /** 输入型提示文字 */
    @ExcelProperty(value = "输入型提示文字")
    @ApiModelProperty(value = "输入型提示文字")
    private String formItemPlaceholder;

    /** 扩展字段 表单项独有字段 */
    @ExcelProperty(value = "扩展字段 表单项独有字段")
    @ApiModelProperty(value = "扩展字段 表单项独有字段")
    private String formItemExpand;

    /** 正则表达式 */
    @ExcelProperty(value = "正则表达式")
    @ApiModelProperty(value = "正则表达式")
    private String formItemRegex;

    /** 是否显示正则表达式 */
    @ExcelProperty(value = "是否显示正则表达式")
    @ApiModelProperty(value = "是否显示正则表达式")
    private Integer formItemShowRegex;

    /** 展示类型组件 */
    @ExcelProperty(value = "展示类型组件")
    @ApiModelProperty(value = "展示类型组件")
    private Integer formItemDisplayType;

    /** 表单项原始配置json */
    @ExcelProperty(value = "表单项原始配置json")
    @ApiModelProperty(value = "表单项原始配置json")
    private String formItemConfig;

    /** 排序 */
    @ExcelProperty(value = "排序")
    @ApiModelProperty(value = "排序")
    private Long sort;

    /** 状态 */
    @ExcelProperty(value = "状态")
    @ApiModelProperty(value = "状态")
    private String status;

    /** 扩展字段1 */
    @ExcelProperty(value = "扩展字段1")
    @ApiModelProperty(value = "扩展字段1")
    private String extend1;

    /** 扩展字段2 */
    @ExcelProperty(value = "扩展字段2")
    @ApiModelProperty(value = "扩展字段2")
    private String extend2;

    /** 扩展字段3 */
    @ExcelProperty(value = "扩展字段3")
    @ApiModelProperty(value = "扩展字段3")
    private String extend3;

    /** 乐观锁 */
    @NotNull(message = "乐观锁不能为空", groups = { Create.class, Update.class })
    @ExcelProperty(value = "乐观锁")
    @ApiModelProperty(value = "乐观锁")
    private Integer version;

    @JsonIgnore
    @Override
    public Long primaryKey() {
        return this.id;
    }

}
